<!DOCTYPE html>
<html>
<head>
    <title>基于微信的GPS巡检平台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=9" />
    <meta http-equiv="content-type" content="text/html;charset=UTF-8">
    <meta http-equiv="Cache-Control" content="max-age=135000" />
    <link id="easyuiTheme" href="__PUBLIC__/js/jquery-easyui-theme/{$_COOKIE.easyuiThemeName|default="default"}/easyui.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/js/jquery-easyui-theme/icon.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/js/icons/icon-all.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/style/syCss.css" rel="stylesheet" type="text/css" />

    <script src="__PUBLIC__/js/jquery-1.8.2.min.js" type="text/javascript"></script>

    <script src="__PUBLIC__/js/jquery-easyui-1.3.6/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="__PUBLIC__/js/jquery-easyui-1.3.6/datagrid-detailview.js" type="text/javascript"></script>
    <script src="__PUBLIC__/js/jquery-easyui-1.3.6/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>

    <script src="__PUBLIC__/js/jquery.jdirk.js" type="text/javascript"></script>

    <!--拖动显示边框-->
    <link href="__PUBLIC__/js/jeasyui-extensions/jeasyui.extensions.css" rel="stylesheet" type="text/css" />
    <script src="__PUBLIC__/js/release/jeasyui.extensions.all.min.js"></script>


    <script src="__PUBLIC__/js/jeasyui-extensions/jquery-easyui-my97/WdatePicker.js" type="text/javascript"></script>
    <script src="__PUBLIC__/js/jeasyui-extensions/jquery-easyui-my97/jquery.my97.js" type="text/javascript"></script>
    <script src="__PUBLIC__/js/syUtil.js" type="text/javascript"></script>
    <!--以上js必须引入-->

    <!--script src="__PUBLIC__/js/jeasyui-extensions/jquery-easyui-my97/WdatePicker.js" type="text/javascript"></script>
    <script src="__PUBLIC__/js/jeasyui-extensions/jquery-easyui-my97/jquery.my97.js" type="text/javascript"></script>
	
	<script src="__PUBLIC__/js/Highcharts-4.0.1/js/highcharts.js"></script>
	<script src="__PUBLIC__/js/Highcharts-4.0.1/js/highcharts-3d.js"></script>
	<script src="__PUBLIC__/js/Highcharts-4.0.1/js/modules/exporting.js"></script>
	<script src="__PUBLIC__/js/Highcharts-4.0.1/js/themes/dark-green.js"></script-->
    <script type="text/javascript">
        var APP = '__APP__/Admin';
        var TMPL = '__ADMINTMPL__';
        var PUBLIC = '__PUBLIC__';
        var ROOT = '__ROOT__';
        $(function() {
            //console.info($.browser.msie);
            if ($.browser.msie) {
                if (parseInt($.browser.version) < 7) {
                    window.location = APP+'/Public/info';
                    //console.info(1);
                }
            }
            document.onkeydown = function(e) {
                var ev = document.all ? window.event : e;
                if (ev.keyCode == 13) {
                    if ($("#LoginForm").form('validate')) {
                        // $.messager.progress({
                        // title : '请稍候',
                        // msg : '正在登录...'
                        // });
                        loginUser();
                    } else {
                        showMsg('请输入用户名和密码！');
                    }
                }
            }
            //判断显示器分辨率显示不同背景图
            //				alert(document.getElementById('body-background').width);
            if (screen.width == 800 && screen.height == 600 || screen.width == 1024 && screen.height == 768 || screen.width == 1400 && screen.height == 1050 || screen.width == 1600 && screen.height == 1200) {
                document.getElementById('body-background').src = '__ADMINTMPL__/Public/login2.jpg';
                document.getElementById('body-background').width = screen.width;
                document.getElementById('body-background').height = screen.height;
            } else if (screen.width == 1366 && screen.height == 768 || screen.width == 1280 && screen.height == 720 || screen.width == 1600 && screen.height == 900 || screen.width == 1920 && screen.height == 1080 || screen.width == 2048 && screen.height == 1152) {
                document.getElementById('body-background').src = '__ADMINTMPL__/Public/login2.jpg';
                document.getElementById('body-background').width = screen.width;
                document.getElementById('body-background').height = screen.height;
            } else if (screen.width == 1280 && screen.height == 800 || screen.width == 1440 && screen.height == 900 || screen.width == 1920 && screen.height == 1200 || screen.width == 1680 && screen.height == 1050) {
                document.getElementById('body-background').src = '__ADMINTMPL__/Public/login2.jpg';
                document.getElementById('body-background').width = screen.width;
                document.getElementById('body-background').height = screen.height;
            }
            //				alert(screen.width);alert(screen.height);  
        });

        function loginUser() {
            $.messager.progress({
                title: '请稍候',
                msg: '正在登录！请稍后...'
            });
            $('#LoginForm').form('submit', {
                url: APP+'/Public/checkLogin',
                onSubmit: function() {
                    var isValid = $(this).form('validate');
                    if (!isValid) {
                        $.messager.progress('close');
                        // 当form不合法的时候隐藏工具条
                    }
                    return isValid;
                    // 返回false将停止form提交
                },
                onLoadError: function() {
                    showMsg('服务器出现故障，请检查服务器是否正常启动！');
                },
                success: function(data) {
                    //console.info(data);
                    $.messager.progress('close');
                    //var obj = $.parseJSON(data);
                    var obj = data;
                    if (obj.status) {
                        // $('#Dialog').dialog('close');
                        window.location = APP+'/Index';
                    }
                    showMsg(obj.info);
                }
            });
        }

        function clearForm() {
            $('#LoginForm').form('load', {
                account: '',
                password: ''
            })
        }

        function regUser() {
            $('<div/>').dialog({
                href: '__TMPL__/Public/reg.html',
                width: 520,
                height: 300,
                modal: true,
                title: '注册用户',
                buttons: [{
                    text: '提交',
                    iconCls: 'icon-edit',
                    handler: function() {
                        var d = $(this).closest('.window-body');
                        var t = $('#admin_yhglAdd_combobox').combobox('getValues'); // 得到树对象
                        //var ne = t.tree('getChecked'); // 得到选择的节点
                        //console.info(t);
                        var li = new Array();
                        $.each(t, function(i, n) {
                            //console.info(value[i].title);
                            li[i] = n;
                        });
                        var account = $('#admin_yhglAdd_account').val();
                        var nickname = $('#admin_yhglAdd_nickname').val();
                        var email = $('#admin_yhglAdd_email').val();
                        var status = $('select[name="status"]').val();
                        var remark = $('textarea[name="remark"]').val();
                        if (t == null || t == '') {
                            showMsg('请选择项目组');
                            return;
                        }
                        $.ajax({
                            type: 'POST',
                            url: '__APP__/Public/reg',
                            data: {
                                account: account,
                                email: email,
                                nickname: nickname,
                                status: status,
                                remark: remark,
                                groupsIds: li
                            },
                            success: function(result) {
                                try {
                                    var r = $.parseJSON(result);
                                    if (r.status == 1) {
                                        $('#admin_yhgl_datagrid').datagrid('load');
                                        d.dialog('destroy');
                                        showMsg(r.info);
                                    } else {
                                        showMsg(r.info);
                                    }
                                } catch (e) {
                                    $.messager.alert('提示', result);
                                }
                            }
                        });
                    }
                }],
                onClose: function() {
                    $(this).dialog('destroy');
                }
            });
        }
    </script>
</head>
<body style="overflow:hidden;margin:0;padding:0; line-height: 20px;" scroll="no">
<img id='body-background' src="__ADMINTMPL__/Public/login2.jpg" width="100" height="100" border=0/>
<div class="easyui-window" data-options="title:'基于微信的GPS巡检平台',draggable:true,closable:false,maximizable:false,minimizable:false,collapsible:false" style="height:260px;width:595px;overflow:hidden;">
    <div class="easyui-layout" data-options="fit:true">
        <div data-options="region:'north',border:false,title:''" style="background: #177e71 repeat-x center 50%; color: #fff; width: 584px; background1:url(__ADMINTMPL__/Public/login2.jpg) top left; height: 200px;align:center">
            <br/>
            <h1 style="text-align:center;font-size:40px;line-height:50px;color:orange">基于微信的GPS巡检平台</h1>
            <hr style="width:500px;border-top:1px solid #0f3455">
        </div>
        <div data-options="region:'south',border:false,title:''" style="overflow: hidden; background: #177e71 repeat-x center 0%; color:#000033; width: 584px; background-image1: url(__ADMINTMPL__/Public/login2.jpg); height:100px; border-top:0px dotted #999999;" align="center">
            <form action="" method="post" id="LoginForm">
                <table>
                    <tr>
                        <td><label for="loginName"> <font size="2px;" color="#FFFFFF"> 用户名： </font> </label>
                            <input type="text" name="account" class="easyui-validatebox" style="color:#000;border:none;border-bottom:1px solid #000;background: transparent;font-family: georgia;width: 150px;" data-options="required:true" id="loginName" />
                        </td>
                    </tr>
                    <tr>
                        <td><label for="password"> <font size="2px;" color="#FFFFFF"> 密　码： </font> </label>
                            <input type="password" name="password" class="easyui-validatebox" style="color:#000;border:none;border-bottom:1px solid #000;background: transparent;width: 150px;" data-options="required:true" id="password" validType="minLength[1]" />
                        </td>
                    </tr>
                    <tr>
                        <td> &nbsp;&nbsp;&nbsp;&nbsp;
                            <a href="#" onclick="clearForm()" class="easyui-linkbutton">
								清除
							</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <a href="#" onclick="loginUser()" class="easyui-linkbutton">
								登录
							</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <!--a href="javascript:regUser();" class="easyui-linkbutton">
								注册
							</a-->
                        </td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
</div>
</body>
</html>